const API = require('./base.js')
const commentList = function(data) {
	return API.post('/api/web/V1/comment/list', data, {
		token: true
	});
}


const articleDetails = function(data) {
	return API.post('/api/web/V1/article/details', data, {
		token: true
	});
}
const videoShortList = function(data) {
	return API.post('/api/web/V1/video/short/list', data);
}

const dramaDetail = function(data) { //短剧
	return API.post('/api/web/V1/drama/detail', data);
}

const dramaPage = function(data) { //更多短剧
	return API.post('/api/web/V1/drama/page', data);
}
const getSignature = function(data) { //更多短剧
	return API.post('/api/web/V1/wx/Signature/getSignature', data);
}
//商城
const ssoLogin = function(data) {//登录
	return API.post('/sso/login', data);
}
const ssoInfo = function(data) {//用户信息
	return API.get('/sso/info', data);
}
const getPublicKey = function(data) {
	return API.get('/sso/login/getPublicKey', data);
}
const updatePassword = function(data) {//修改密码
	return API.post('/sso/login/updatePassword', data);
}

const homeContent = function(data) {//首页商品列表
	return API.get('/home/content', data);
}
const recommendProductList = function(data) {
	return API.get('/home/recommendProductList', data);
}
const productDetail = function(data) {//商品详情
	return API.get('/product/detail/' + data);
}
const register = function(data) {//注册
	return API.post('/sso/register',data);
}

const cartList = function(data) { //购物车列表
	return API.get('/cart/list', data);
}
const cartDelete = function(data) {//删除购物车商品
	return API.post('/cart/delete?ids='+data);
}

const updateQuantity = function(data) {//修改购物车商品数量
	return API.get('/cart/update/quantity',data);
}
const cartAdd = function(data,args) {
	return API.post('/cart/add', data,args); //添加购物车

}
const getAuthCode = function(data,args) {//获取验证码
	return API.post('/sms/send', data,args);
}
const generateConfirmOrder = function(data, args) {
	return API.post('/order/generateConfirmOrder', data, args); //订单信息
}

const orderGenerateOrder = function(data,args) {
	return API.post('/order/generateOrder', data,args); //提交订单
}
const generateOrderBySku = function(data,args) {
	return API.post('/order/generateOrderBySkuId', data,args); //商品提交订单
}

const orderlist = function(data) {
	return API.get('/order/list/', data);
}

const cancelUserOrder = function(data,args) {//取消订单
	return API.post('/order/cancelUserOrder', data ,args);
}
const getOrderSetting = function(data,args) {//订单倒计时
	return API.get('/order/getOrderSetting', data ,args);
}


const orderUpdateAddress = function(data,args) {//订单修改地址
	return API.post('/order/updateAddress', data ,args);
}


const orderDetail = function(data) {//订单详情
	return API.get('/order/detail/'+data );
}
const expressInfo = function(data,args) {
	return API.post('/tools/express/info', data ,args);
}
const orderGoods = function(data,args) {
	return API.post('/order/generateConfirmOrderByBuyNow', data ,args);
}
const cancelOrder = function(data,args) {//订单倒计时取消订单
	return API.post('/order/cancelOrder', data ,args);
}
const orderPaySuccess = function(data,args) {//订单支付
	return API.post('/order/paySuccess', data ,args);
}

const confirmReceiveOrder = function(data,args) {//确认收货
	return API.post('/order/confirmReceiveOrder', data ,args);
}
const productCateList = function(data,args) {//商品分类
	return API.get('/home/productCateList/2', data ,args);
}
const productSearch = function(data,args) {//商品分类
	return API.get('/product/search', data ,args);
}
const productCollectionDetail = function(data,args) {//商品收藏详情
	return API.post('/member/productCollection/detail?',data,args);
}

const productCollectionDelete = function(data,args) {//商品取消收藏
	return API.post('/member/productCollection/delete',data,args);
}
const productCollectionAdd = function(data,args) {//收藏商品
	return API.post('/member/productCollection/add',data,args);
}

const addressList = function(data,args) {//收货地址
	return API.get('/member/address/list', data ,args);
}
const addressUpdate = function(data,args) {//收货地址
	return API.post('/member/address/update/'+data.id, data ,args);
}
const addressDetails= function(data,args) {//收货地址详情
	return API.get('/member/address/'+data,args);
}
const addressAdd = function(data,args) {//收货地址
	return API.post('/member/address/add', data ,args);
}

const addressDelete = function(data) {//删除收货地址
	return API.post('/member/address/delete/'+data );
}
const productCollectionList = function(data,args) {//我的收藏
	return API.post('/member/productCollection/page', data,args);
}



API.commentList = commentList
API.articleDetails = articleDetails
API.videoShortList = videoShortList
API.dramaDetail = dramaDetail
API.dramaPage = dramaPage
API.getSignature = getSignature
API.cartList = cartList
API.cartAdd = cartAdd
API.ssoLogin = ssoLogin
API.getPublicKey = getPublicKey
API.homeContent = homeContent
API.ssoInfo = ssoInfo
API.recommendProductList = recommendProductList
API.productDetail = productDetail
API.register = register
API.getAuthCode = getAuthCode
API.generateConfirmOrder = generateConfirmOrder
API.orderGenerateOrder = orderGenerateOrder
API.orderlist = orderlist
API.orderDetail = orderDetail
API.getOrderSetting=getOrderSetting
API.cancelUserOrder = cancelUserOrder
API.expressInfo = expressInfo
API.cartDelete = cartDelete
API.orderGoods = orderGoods
API.orderPaySuccess = orderPaySuccess
API.confirmReceiveOrder=confirmReceiveOrder
API.productCollectionAdd = productCollectionAdd
API.productCateList = productCateList
API.productCollectionDelete = productCollectionDelete
API.productCollectionDetail=productCollectionDetail
API.productSearch = productSearch
API.addressList = addressList
API.addressUpdate = addressUpdate
API.addressDetails = addressDetails
API.generateOrderBySku = generateOrderBySku
API.addressAdd = addressAdd
API.cancelOrder= cancelOrder
API.addressDelete = addressDelete
API.orderUpdateAddress = orderUpdateAddress
API.productCollectionList= productCollectionList
API.updatePassword= updatePassword
API.updateQuantity=updateQuantity
module.exports = API